<?php
/**
 * @Notes: 文件描述
 * @Interface getCondition
 * @Return mixed
 * @Author: bqs
 * @Time: 2021/4/19 15:28
 */

namespace app\common\command;

use think\console\Command;
use think\console\Input;
use think\console\Output;
use think\console\input\Argument;
use think\console\input\Option;
use think\Db;
use think\facade\Hook;
use think\facade\Log;

class SyncProducts extends Command
{

    protected function configure()
    {
        $this->setName('sync:products')
            ->addArgument('cate_id', Argument::OPTIONAL, "分类ID")
            ->addOption('num', null, Option::VALUE_REQUIRED, '同步数量')
            ->setDescription('产品同步到Es');
    }

    protected function execute(Input $input, Output $output)
    {
        $options = $input->getOptions();
        $argurment = $input->getArguments();

        $output->writeln("!!!hello sync_products!!!". json_encode($options, JSON_UNESCAPED_UNICODE). "===参数===". json_encode($argurment, JSON_UNESCAPED_UNICODE));
    }


}